package com.imooc.api.controller.user;

import com.imooc.grace.result.GraceJSONResult;
import com.imooc.pojo.bo.LogoutBO;
import com.imooc.pojo.bo.RegistLoginBO;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;

/**
 * 用户注册登录
 */
@RequestMapping("/passport")
public interface PassportControllerApi {

    /**
     * 获得短信验证码
     */
    @GetMapping("/getSMSCode")
    GraceJSONResult getSMSCode(@RequestParam String mobile, HttpServletRequest request);

    /**
     * 一键注册登录接口
     */
    @PostMapping("/doLogin")
    GraceJSONResult doLogin(@Valid @RequestBody RegistLoginBO registLoginBO, BindingResult result, HttpServletResponse response);

    /**
     * 用户退出登录
     */
    @PostMapping("/logout")
    GraceJSONResult logout(@Valid @RequestBody LogoutBO logoutBO, HttpServletResponse response);

}